import java.util.LinkedList;

class BoardListPair
{
    private Board b;
    private LinkedList<Position> l;

    public BoardListPair(Board b, LinkedList<Position> l) 
    {
        this.b = new Board();
        this.b.setElements(b.getElements().clone());
        this.l = new LinkedList<Position>();
        this.l.addAll(l);
    }

    public boolean equals(BoardListPair blp)
    {
    	BoardElement[][] tels = this.b.getElements();
    	BoardElement[][] oels = blp.getB().getElements();
        LinkedList<Position> olist = blp.getL();

        if((tels.length != oels.length) || 
           (tels[0].length != oels[0].length) ||
            (this.l.size() != olist.size()))
            return false;


        for(int i = 0; i < tels.length; ++ i)
            for(int j = 0; j < tels[0].length; ++ j)
                if(tels[i][j] != oels[i][j])
                    return false;

        for(Position p : this.l)
            if(olist.indexOf(p) == -1)
                return false;

        return true;
    }

    public Board getB(){return this.b;}
    public LinkedList<Position> getL(){return this.l;}
}
